package com.lxx.onlineview.mapper;

import com.lxx.onlineview.entity.po.Teacher;
import com.lxx.onlineview.entity.po.User;
import java.util.List;

import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {
    @InsertProvider(value = UserProvider.class,method = "insert")
    int insert(User record);

    @Select("select * from user where username = #{username}")
    User selectByPrimaryKey(@Param("username") String username);

    @Select("select * from user where type = #{type}")
    List<User> selectAll(String type);

    @UpdateProvider(value = UserProvider.class,method = "update")
    int updateByPrimaryKey(User record);

    @Select("select * from user where username = #{username} and password = #{password}")
    User selectByUserAndPwd(String username, String password);

}
